﻿@using Coslen.Framework.Helpers
@model Coslen.TahorCRM.Domain.Entities.ViewModels.Editing.AddressEditViewModel
           
<div class="address_DisplayLine">
    <div class="info">
        @Html.HiddenFor(model => model.Address.AddressId)
        @Html.DisplayFor(model => model.Address.DisplayAddress)
    </div>
    <div class="type">
        @Html.DisplayFor(model => model.Address.AddressType.Name)
    </div>
    <div class="displaybool">
        @Html.DisplayFor(model => model.Address.IsPrimary)
    </div>
    <div class="displaybool">
        @Html.DisplayFor(model => model.Address.DoNotUse)
    </div>
    <div class="tool">
        @if (User.IsInRole("CanEditContact"))
        {
            @Html.ImageActionLink(
                Url.Content("~/Content/Images/edit.png"),
                "Edit",
                "Edit",
                "Address",
                new {area = "Contacts", id = Model.Address.AddressId, source = "Contact:Details:" + Model.Address.EntityLink.ContactId},
                new {@class = ""},
                new {@class = "actionIcon"})

            @Html.ImageActionLink(
                Url.Content("~/Content/Images/delete.png"),
                "Delete",
                "Delete",
                "Address",
                new {area = "Contacts", id = Model.Address.AddressId, source = "Contact:Details:" + Model.Address.EntityLink.ContactId},
                new {@class = ""},
                new {@class = "actionIcon"})
        }
        <img src="@Url.Content("~/Content/images/home.png")" alt="center" onclick="centerMap('@( Model.Address.DisplayAddress)');" class="actionIcon" title="Show in Map" />
    </div>
</div>
